package com.lsa.letcode.the49.anagrams;

import java.util.Arrays;



import java.util.Collections;
import java.util.List;

import org.junit.Assert;
import org.junit.Test;

public class AnagramsTest {
	@Test
	public void test(){
		Solution s = new Solution();
		test(Arrays.asList("a", "a", "a"), s.anagrams(new String[]{"a","a","a"}));
		test(Arrays.asList("debit card", "bad credit", "motherinlaw", "womanhitler"), s.anagrams(new String[]{"motherinlaw", "debit card","womanhitler", "ab", "bad credit"}));
	}

	private void test(List<String> expected, List<String> actual) {
		Collections.sort(expected);
		Collections.sort(actual);
		Assert.assertEquals(expected, actual);
	}
}